package org.jiuling.wechat.publicplatform.api;

import org.jiuling.local.tools.convert.MapConvert;
import org.jiuling.local.tools.exception.LocalToolsException;
import org.jiuling.wechat.publicplatform.model.WeChatMsg;
import org.jiuling.wechat.publicplatform.util.WeChatXMLUtil;

/**
 * 微信解析
 * @author 紫灵
 * @date 2022年04月25日 23时54分36秒
 */
public class WeChatParse {

    public static WeChatMsg parseMsg(String xmlMsg) throws LocalToolsException {
        return MapConvert.toObject(WeChatXMLUtil.XMLStrToMap(xmlMsg), WeChatMsg.class);
    }

}
